package de.kai_morich.simple_usb_terminal;

import com.hoho.android.usbserial.driver.CdcAcmSerialDriver;
import com.hoho.android.usbserial.driver.ChromeCcdSerialDriver;
import com.hoho.android.usbserial.driver.CommonUsbSerialPort;
import com.hoho.android.usbserial.driver.FtdiSerialDriver;
import com.hoho.android.usbserial.driver.ProbeTable;
import com.hoho.android.usbserial.driver.ProlificSerialDriver;
import com.hoho.android.usbserial.driver.UsbSerialProber;

/**
 * add devices here, that are not known to DefaultProber
 *
 * if the App should auto start for these devices, also
 * add IDs to app/src/main/res/xml/usb_device_filter.xml
 */
class CustomProber {

    static UsbSerialProber getCustomProber() {
        ProbeTable customTable = new ProbeTable();
        customTable.addProduct(0x4348, 0x5537, ChromeCcdSerialDriver.class);
        customTable.addProduct(0x4348, 0x5538, ChromeCcdSerialDriver.class);
        customTable.addProduct(0x1C00, 0x5537, ChromeCcdSerialDriver.class);
        customTable.addProduct(0x1A86, 0x5576, ChromeCcdSerialDriver.class);// e.g. device with custom VID+PID
        customTable.addProduct(0x1A86, 0x7534, FtdiSerialDriver.class);// e.g. device with custom VID+PID
        return new UsbSerialProber(customTable);
    }

}
